
use global_BLAs_09_21_21, clear

merge 1:1 ID using bla_coding_first_09_27_21.dta

keep if _merge==3

/*Confirming the data are correct

gen data_correct = 1 if (countryA==coded_countryA & countryB==coded_countryB | countryA==coded_countryB & countryB==coded_countryA) & year==coded_year
replace data_correct = 0 if data_correct==. & _merge==3

browse ID countryA countryB year coded_countryA coded_countryB coded_year agreement_title ///
	if data_correct==0

*/

gen governance_title  = 0, b(intl_instr)
lab var governance_title "{bf:Governance of Labor Migration}"

gen protection_title = 0, b(migrant_info)
lab var protection_title "{bf:Protection and Empowerment of Migrant Workers}"
gen protection_space = 0, b(protection_title)
lab var protection_space " "

gen dev_title = 0, b(mig_human_cap)
lab var dev_title "{bf:Migration and Development}"
gen dev_space = 0, b(dev_title)
lab var dev_space " "

vl create barvars = (governance_title-recruit_auth labor_union_orig-perm_resid)

vl create barvars1 = (intl_instr-recruit_auth labor_union_orig-ngos)
vl create barvars2 = (migrant_info-disputes_emp_mig)
vl create barvars3 = (mig_human_cap-perm_resid)

*1) Histogram by year

#delimit;

hist year if year>=1945, discrete frequency color(gs12) lc(black) ylab(#8, angle(0))
	xlab(1945(5)2020, angle(45) labsize(*0.6)) graphregion(color(white))
	name(coded_hist, replace) yt("") xt("");

#delimit cr
